package day4.liberary.operator;

import day4.liberary.book1.booklist;

import java.awt.font.FontRenderContext;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: watermelon
 * Date: 2025-05-30
 * Time: 23:21
 */
public class backbook implements Job{
    @Override
    public void working(booklist list) {
        if(list.browbook==null)
        {
            System.out.println("目前没有可以归还的图书");
        }
        else {
            for (int i = 0; i < list.capacity; i++) {
                if(list.booklist[i].getName().equals(list.browbook))
                {
                    list.booklist[i].setIsborrowed(false);
                    System.out.println("归还成功");
                    list.browbook=null;
                    break;
                }
            }
        }
    }
}
